package nl.scalasim

import scala.actors.Actor


object Simulation extends Application {
  val producer = new Producer("Candy repository", "candy")
  println("[Sim] Constructed a producer called %s that produces %s"
          .format(producer.name, producer.goods))

  producer start

  producer ! "hello world"
  producer !? Produce match {
    case Produced(goods, amount) =>
      println("[Sim] Harvested %d of type %s".format(amount, goods))
  }
  producer ! Stop
}